/**
 * Note: 路由配置项
 *
 * path: '/path'                    // 路由路径
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * meta : {
    title: 'title'                  // 设置该路由在侧边栏的名字
    icon: 'icon-name'                // 设置该路由的图标
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
    query: '{"id": 1}'             // 访问路由的默认传递参数
    hidden: true                   // 当设置 true 的时候该路由不会在侧边栏出现 
    hideTab: true                   //当设置 true 的时候该路由不会在多标签tab栏出现
  }
 */

import type { RouteRecordRaw } from 'vue-router'

import { PageEnum } from '@/enums/pageEnum'
import Layout from '@/layout/default/index.vue'

export const LAYOUT = () => Promise.resolve(Layout)

export const INDEX_ROUTE_NAME = Symbol()

export const constantRoutes: Array<RouteRecordRaw> = [
    {
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/error/404.vue')
    },
    {
        path: PageEnum.ERROR_403,
        component: () => import('@/views/error/403.vue')
    },
    {
        path: PageEnum.ENTRANCE_403,
        component: () => import('@/views/error/entrance/403.vue')
    },
    {
        path: PageEnum.ENTRANCE_404,
        component: () => import('@/views/error/entrance/404.vue')
    },
    {
        path: PageEnum.LOGIN,
        component: () => import('@/views/account/login.vue')
    },
    {
        path: '/user',
        component: LAYOUT,
        children: [
            {
                path: 'setting',
                component: () => import('@/views/user/setting.vue'),
                name: Symbol(),
                meta: {
                    title: '个人设置'
                }
            }
        ]
    },
    {
        path: '/poster',
        component: LAYOUT,
        children: [
            {
                path: 'index',
                component: () => import('@/views/ai/poster/index.vue'),
                name: Symbol(),
                meta: {
                    title: 'AI海报设计'
                }
            }
        ]
    },
    {
        path: '/decoration/pc_details',
        component: () => import('@/views/decoration/pc_details.vue')
    },

    {
        path: '/customer-service',
        component: LAYOUT,
        children: [
            {
                path: 'inside_list',
                component: () => import('@/views/customer-service/inside/index.vue'),
                name: Symbol(),
                meta: {
                    title: '内部客服列表',
                    icon: 'headset'
                }
            },
            {
                path: 'inside_detail',
                component: () => import('@/views/customer-service/inside/detail.vue'),
                name: Symbol(),
                meta: {
                    title: '内部客服会话详情',
                    activeMenu: '/customer-service/inside_list',
                    hidden: true
                }
            },
            {
                path: 'list',
                component: () => import('@/views/customer-service/index.vue'),
                name: Symbol(),
                meta: {
                    title: '客服列表',
                    icon: 'headset'
                }
            },
            {
                path: 'detail',
                component: () => import('@/views/customer-service/detail.vue'),
                name: Symbol(),
                meta: {
                    title: '会话详情',
                    activeMenu: '/customer-service/list',
                    hidden: true
                }
            },
            {
                path: 'auth/index',
                component: () => import('@/views/customer-service/auth/index.vue'),
                name: Symbol(),
                meta: {
                    title: '应用授权',
                    activeMenu: '/customer-service/auth/index',
                    hidden: true
                }
            },
        ]
    },
    {
        path: '/dashboard',
        component: LAYOUT,
        children: [
            {
                path: 'index',
                component: () => import('@/views/dashboard/index.vue'),
                name: Symbol(),
                meta: {
                    title: '数据大盘',
                    icon: 'DataAnalysis'
                }
            }
        ]
    },
    {
        path: '/customer-group',
        component: LAYOUT,
        name: 'CustomerGroup',
        children: [
            {
                path: 'index',
                component: () => import('@/views/customer-group/index.vue')
            },
            {
                path: 'contacts',
                component: () => import('@/views/customer-group/contacts.vue')
            }
        ]
    },
    {
        path: '/notification',
        component: LAYOUT,
        children: [
            {
                path: 'index',
                component: () => import('@/views/notification/index.vue'),
                name: Symbol(),
                meta: {
                    title: '系统通知',
                    icon: 'Bell'
                }
            }
        ]
    }
    // {
    //     path: '/dev_tools',
    //     component: LAYOUT,
    //     children: [
    //         {
    //             path: 'code/edit',
    //             component: () => import('@/views/dev_tools/code/edit.vue'),
    //             meta: {
    //                 title: '编辑数据表',
    //                 activeMenu: '/dev_tools/code'
    //             }
    //         }
    //     ]
    // },
    // {
    //     path: '/setting',
    //     component: LAYOUT,
    //     children: [
    //         {
    //             path: 'dict/data',
    //             component: () => import('@/views/setting/dict/data/index.vue'),
    //             meta: {
    //                 title: '数据管理',
    //                 activeMenu: '/setting/dict'
    //             }
    //         }
    //     ]
    // }
]

export const INDEX_ROUTE: RouteRecordRaw = {
    path: PageEnum.INDEX,
    component: LAYOUT,
    name: INDEX_ROUTE_NAME
}
